{extend name="/fool" /}
{block name="css"}
<link rel="stylesheet" href="/css/admin/order.css">
{/block}
{block name="menu_content"}
<div id="one">
    <form class="layui-form" action="" method="post">
        <ul>
            <li>
                <div>
                    <div class="layui-input-inline">
                        <div class="layui-input-inline">
                            <input type="text" name="orderid" autocomplete="off" class="layui-input" placeholder="订单号">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" name="user" autocomplete="off" class="layui-input" placeholder="用户">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" name="time" class="layui-input" id="test1" placeholder="开始时间 至 结束时间">
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <div class="layui-input-inline">
                    <select name="class">
                        <option value="">请选择问题</option>
                        <optgroup label="城市记忆">
                            <option value="你工作的第一个城市">你工作的第一个城市</option>
                        </optgroup>
                        <optgroup label="学生时代">
                            <option value="你的工号">你的工号</option>
                            <option value="你最喜欢的老师">你最喜欢的老师</option>
                        </optgroup>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <input type="text" name="name" autocomplete="off" class="layui-input" placeholder="名称">
                </div>
                <div class="layui-input-inline">
                    <select name="status">
                        <option value="">请选择问题</option>
                        <optgroup label="城市记忆">
                            <option value="你工作的第一个城市">你工作的第一个城市</option>
                        </optgroup>
                        <optgroup label="学生时代">
                            <option value="你的工号">你的工号</option>
                            <option value="你最喜欢的老师">你最喜欢的老师</option>
                        </optgroup>
                    </select>
                </div>
                <button type="Submit" class="layui-btn">筛选</button>
            </li>
        </ul>
    </form>
</div>
<div>
    <table>
        <tr>
            <th>所属类型</th>
            <th>名称</th>
            <th>充电宝编号</th>
            <th>用户</th>
            <th>租聘时间</th>
            <th>状态</th>
            <th class="last">操作</th>
        </tr>
        {if isset($list)}
        {foreach $list as $v}
        <tr class="list">
            <td>{$v.title}</td>
            <td>{$v.title}</td>
            <td>{$v.title}</td>
            <td>{$v.title}</td>
            <td>{$v.title}</td>
            <td>{$v.title}</td>
            <td>
                <button sid="{$v.id}" type="button" class="viewbu layui-btn">详情</button>
            </td>
        </tr>
        {/foreach}
        {else}
        <tr class="list">
            <td>代理商家</td>
            <td>55555</td>
            <td>12312312</td>
            <td>12412412</td>
            <td>124124</td>
            <td>12412</td>
            <td>
                <button sid="1" type="button" class="viewbu layui-btn">详情</button>
            </td>
        </tr>
        <tr class="list">
            <td>代理商家</td>
            <td>55555</td>
            <td>12312312</td>
            <td>12412412</td>
            <td>124124</td>
            <td>12412</td>
            <td>
                <button sid="1" type="button" class="viewbu layui-btn">详情</button>
            </td>
        </tr>
        <tr class="list">
            <td>代理商家</td>
            <td>55555</td>
            <td>12312312</td>
            <td>12412412</td>
            <td>124124</td>
            <td>12412</td>
            <td>
                <button sid="1" type="button" class="viewbu layui-btn">详情</button>
            </td>
        </tr>
        {/if}
    </table>
    {if isset($list)}
    {$page|raw}
    {/if}
</div>
<script>
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#test1'
            ,type: 'month'
            ,range: '至'
            ,format: 'yyyy-MM'
        });
    });
    $(".viewbu").click(function(){
        var id = $(this).attr('sid');
        var url = "{:url('view',['id'=>'1','index'=>'0'])}" + '&view=' + '0' + '&battery_order=' + id;
        console.log(url);
        location.href = url;
    })
</script>
{/block}